using GameFramework.Localization;
using Unity.VisualScripting;

namespace LS.UGFUnits
{
    [UnitSurtitle("Game Base Property")]
    [UnitShortTitle("Get")]
    public sealed class GetGameBaseProperty: BaseUnit
    {
        [DoNotSerialize]
        public ValueOutput EditorResourceMode_EditorOnly { get; private set; }
        
        [DoNotSerialize]
        public ValueOutput EditorLanguage_EditorOnly  { get; private set; }
        
        [DoNotSerialize]
        public ValueOutput FrameRate  { get; private set; }
        
        [DoNotSerialize]
        public ValueOutput GameSpeed  { get; private set; }
        
        [DoNotSerialize]
        public ValueOutput IsGamePaused  { get; private set; }
        
        [DoNotSerialize]
        public ValueOutput IsNormalGameSpeed  { get; private set; }
        
        [DoNotSerialize]
        public ValueOutput RunInBackground  { get; private set; }
        
        [DoNotSerialize]
        public ValueOutput NeverSleep  { get; private set; }
        
        protected override ControlOutput In(Flow flow)
        {
            flow.SetValue(EditorResourceMode_EditorOnly, Target?.EditorResourceMode ?? false);
            flow.SetValue(EditorLanguage_EditorOnly, Target?.EditorLanguage ?? Language.Unspecified);
            flow.SetValue(FrameRate, Target?.FrameRate ?? 0);
            flow.SetValue(GameSpeed, Target?.GameSpeed ?? 0);
            flow.SetValue(IsGamePaused, Target?.IsGamePaused ?? false);
            flow.SetValue(IsNormalGameSpeed, Target?.IsNormalGameSpeed ?? false);
            flow.SetValue(RunInBackground, Target?.RunInBackground ?? false);
            flow.SetValue(NeverSleep, Target?.NeverSleep ?? false);
            return base.In(flow);
        }
    }
}